﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="PopupBookOffHandling.aspx.cs"
    Inherits="MTRC.ODMS.Web.SOM.Popup.PopupBookOffHandling" %>
    <%@ Register Src="../UserControl/UCSignatureNew.ascx" TagName="UCSignatureNew" TagPrefix="ucn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <base target="_self" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .lbl{width:100px;}
    .divSet{padding-top:8px;padding-bottom:12px;}
    .tdLeftLoc{width:15px;}
    .hr{width:100%;}
    .txt{width:180px;}
</style>
    <script src="../../jQuery/jquery-1.6.2.min.js" type="text/javascript"></script>
  <script language="javascript" type="text/javascript">
      function callReturn(s) {
        window.returnValue = s; //1467
        self.close(); 
    }
    function Init()
    {
        document.getElementById("hdArrivalDate").value=window.dialogArguments .form1.hdnArrivalDate.value;
        document.getElementById("hdArrivalTime").value = window.dialogArguments.form1.hdnArrivalTime.value;
        //add by gordon 20150812
        document.getElementById("hdnEventPersonID").value = window.dialogArguments.form1.hdnStationEventPersonID.value;
    }

    //---------------- Add by zengshunbo 2009-03-18 issue:1113 -----------------
    //Delete by gordon 20150818
    //1.The new Logic is include this checking
    //2.This checking will let the fields [restore handledby] & [restore chubb] be empty
    //So delete it
//    function ShownFireSystemWaringMessage()
//    {
//        var waringMsg = document.getElementById("hdnWaringMessage").value;
//        var chkRestore = document.getElementById("chkUnRestoreFirelink");
//        
//        if(waringMsg.length > 0 && chkRestore.checked)
//        {
//            return confirm(waringMsg);
//        }
//        else
//        {
//            return true;
//        }
//    }
    //---------------- End add by zengshunbo 2009-03-18 issue:1113 -----------------
    //add by gordon 20150811 U147
    function CheckUnRestore() {
        var chkRestore = document.getElementById("chkUnRestoreFirelink");
        if (chkRestore && chkRestore.checked) { 
             var tempId = window.dialogArguments.form1.hdnTempID.value;
             $.post("PopupBookOffHandling.aspx?MODE=chkUnRestore", { TEMPID: tempId }, function (result) {
                 var arrResult = result.split('-'); //0.result 1.control key
                 if (arrResult[0] != "2") {
                     var flag = confirm('<%=GetMessage("SOM_UnRestoreMsg") %>');
                     if (flag) {
                         window.dialogArguments.unRestoreParams = arrResult[0] + "|" + arrResult[1];
                         callReturn("");
                         return;
                     } 
                     else {
                         document.getElementById("btnSaveAndProceed").disabled = false;
                     }
                 } else {
                     __doPostBack("btnSaveAndProceed", "");
                 }
             });
        }else{
            __doPostBack("btnSaveAndProceed", "");
        }
        return false;
    }
  </script>
</head>
<body onload ="Init();">
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <br />
            <div class="divSet">
                <asp:UpdatePanel runat="server" ID="udpUser">
                    <ContentTemplate>
                        <div>
                            <span>
                                <asp:CheckBox ID="chkUser" runat="server" AutoPostBack="True" OnCheckedChanged="chkUser_CheckedChanged" /></span>
                        </div>
                        <table runat="server" id="tblUser" width="100%">
                            <tr>
                                <td class="tdLeftLoc">
                                </td>
                                <td class="lbl">
                                    <span>
                                        <asp:Label runat="server" ID="lblUserID"></asp:Label></span></td>
                                <td>
                                    <span style="width: 180px;">
                                        <asp:TextBox runat="server" ID="txtUserID"></asp:TextBox></span></td>
                            </tr>
                            <tr>
                                <td class="tdLeftLoc">
                                </td>
                                <td>
                                    <span class="lbl">
                                        <asp:Label runat="server" ID="lblPassword"></asp:Label></span></td>
                                <td>
                                    <span class="txt">
                                        <asp:TextBox runat="server" ID="txtPassword" TextMode="Password"></asp:TextBox></span></td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <hr class="hr" />
            <div class="divSet">
                <span class="lbl">
                    <asp:Label runat="server" ID="lblStationDepartTime"></asp:Label></span> <span class="lbl">
                        <asp:Label runat="server" ID="txtStationDepartTime"></asp:Label></span>
                <span class="lbl">
                    <asp:Label runat="server" ID="lblAmendTime"></asp:Label></span> <span class="lbl"
                        style="display: none;">
                        <asp:Label runat="server" ID="lblHideReason"></asp:Label></span>
                <%--       <span class ="lbl"><asp:Label runat =server ID =""></asp:Label></span>--%>
                <span>
                    <asp:Button ID="btnAmendTime" runat="server" Text="..." /></span>
            </div>
            <div class="display:none">
                <input type="Hidden" id="hdDepartDate" runat="server" />
                <input type="Hidden" id="hdDepartTime" runat="server" />
                <input type="Hidden" id="hdAmendReason" runat="server" />
                <input type="Hidden" id="hdArrivalDate" runat =server value ="aaa" />
                <input type="Hidden" id="hdArrivalTime" runat =server value ="aaa" />
                <input type="hidden" id="hdnWaringMessage" runat="server" />
                
            </div>
        </div>
        <hr class="hr" />
        <div runat="server" id="divUnCompleteEvent" class="divSet">
            <div>
                <span>
                    <asp:Label ID="lblUnCompleteState" runat="server"></asp:Label></span>
            </div>
            <div>
                <span>
                    <asp:CheckBox ID="chkUnReturnedAssetLoan" runat="server" /></span> <span>
                        <asp:PlaceHolder runat="server" ID="phUnReturnedAssetLoan"></asp:PlaceHolder>
                    </span>
            </div>
            <div>
                <span>
                    <asp:CheckBox ID="chkUnRestoreFirelink" runat="server" /></span> <span>
                        <asp:PlaceHolder runat="server" ID="phUnReStoredFireLink"></asp:PlaceHolder>
                    </span>
            </div>
            <div>
                <span>
                    <asp:CheckBox runat="server" ID="chkSetLocalToRemote" /></span> <span>
                        <asp:PlaceHolder runat="server" ID="phLocalECS"></asp:PlaceHolder>
                    </span>
            </div>
        </div>
        <div runat="server" id="divNoOutStanding" class="divSet">
            <span style="text-align: center">
                <asp:Label runat="server" ID="lblNoOutStanding"></asp:Label></span>
        </div>
        <div runat="server" id="div1" class="divSet">
            <div style="float: left; width: 100%;">
                <div style="float: left; width: 16%;">
                    <asp:Label ID="lblArrivalCaption" runat="server" CssClass="title1"></asp:Label>
                    <em id="emMandatory" runat="server" visible="false">*</em>
                </div>
                <div style="float: left; width: 83%;">
                    <input type="hidden" runat="server" id="hdnStationEventSignID" />
                    <input type="hidden" runat="server" id="hdnSignatureTypeArrive" />
                    <input type="hidden" runat="server" id="hdnSignatureNameArrive" />
                    <input type="hidden" runat="server" id="hdnSignatureFullFileName" />
                    
                    <ucn:UCSignatureNew ID="ucSignatureNew1" runat="server" />
                    <%--ucSignatureArrival--%>
                </div>
            </div>
        </div>
        <hr class="hr" />
        <asp:HiddenField ID="hdnEventPersonID" ClientIDMode="Static" runat="server" />
        <div style="text-align: right">
            <span>
                <%-- update by gordon 20150811 U147 --%>
                <%--<asp:Button runat="server" ID="btnSaveAndProceed" OnClientClick="return ShownFireSystemWaringMessage();" OnClick="btnSaveAndProceed_Click" /></span>--%>
                <asp:Button runat="server" ID="btnSaveAndProceed" OnClientClick="this.disabled=true;return CheckUnRestore();" OnClick="btnSaveAndProceed_Click" /></span>
            <span>
                <asp:Button runat="server" ID="btnCancel" OnClick="btnCancel_Click" OnClientClick="window.dialogArguments.unRestoreParams='';callReturn('')" /></span>&nbsp;  <!--1467-->
        </div>
    </form>
</body>
</html>
